package com.un.ebs.invoice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.un.ebs.invoice.domain.InvoiceNoteItem;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * (InvoiceNoteItem)表数据库访问层
 *
 * @author liubo
 * @since 2020-09-27 13:09:53
 */
public interface InvoiceNoteItemMapper extends BaseMapper<InvoiceNoteItem> {

    @Select("select * from tb_invoice_note_item where inventory_note_id = #{id}")
    InvoiceNoteItem selectByInventoryNoteId(@Param("id") String id);

    @Select("select sum(invoice_qty) from tb_invoice_note_item where inventory_note_id = #{inventoryNoteId} and sku_id = #{skuId}")
    Double selectSumByInventoryNoteIdAndSkuId(@Param("inventoryNoteId") String inventoryNoteId, @Param("skuId") String skuId);


}